<?php

namespace Database\Seeders;

use App\Models\AdminModel;
use Illuminate\Database\Seeder;

class AdminSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        if (!AdminModel::query()->where('account', 'admin')->exists()) {
            AdminModel::create([
                'account' => env("DEFAULT_ACCOUNT", "admin"),
                'password' => password_hash(env("DEFAULT_PASSWORD", "123456"), PASSWORD_BCRYPT),
                'avatar' => 'https://himg.bdimg.com/sys/portraitn/item/public.1.27114569.rBEJz5tQdh2CMNSn0ufYlQ',
                'name' => 'makers',
                'is_super' => AdminModel::IS_SUPER_YES,
                'status' => AdminModel::STATUS_OPEN
            ]);
        }
    }
}
